﻿@model List<LeEdu.MODEL.Note>
    
@{
    Layout = null;
    LeEdu.BLL.BaseBLL<LeEdu.MODEL.Hour> hourbll = new LeEdu.BLL.BaseBLL<LeEdu.MODEL.Hour>();
    List<LeEdu.MODEL.Hour> hour = hourbll.getEntityList(t=>true).ToList();
    
}

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="">
<!--<![endif]-->
<!-- 网页头部分布视图 -->
@Html.Partial("~/Views/Shared/HouTai_Header.cshtml")


<body>

    <script>
    //全选
    function QX(che) {
        if ($('#ch')[0].checked) {

            $('input[name="check"]').prop("checked", true);
        }
        else {
            $('input[name="check"]').prop("checked", false);
        }
    }

    //批量删除
    //批量删除
    function PLDel() {
        var a = "";
        $('input[name="check"]:checked').each(function () {
            a += $(this).val() + ',';
        });
     
        if (a == "") {
       
            alert('选择删除的项！');
            return false;
        }
        a = a.substring(0, a.length - 1);

        if (confirm('确定删除吗？')) {
            $.post('/Course/PLDel', { id: a }, function (da) {
                if (da == 1) {
                    alert('删除成功！');
                    location.href = '/Course/Notes';
                }
                else {
                    alert('删除失败！');
                }
            })
        }
    }
    </script>

    <!-- 网页导航菜单分布视图 -->
    @Html.Partial("~/Views/Shared/HouTai_DaoHang.cshtml")

    <div class="container">
        <div class="row">

            <!-- 网页左侧菜单分布视图 -->
            @Html.Partial("~/Views/Shared/HouTai_Left_Menu_Course.cshtml")


            <div class="col-md-10">
                <div class="page-header clearfix">
                    <h1 class="pull-left">笔记管理</h1>
                    <div class="pull-right">

                    </div>
                </div>




                <div class="well well-sm">
                    <form class="form-inline" method="post" action="/Course/Notes">
                        <div class="form-group">
                            <select class="form-control" name="HourID" id="HourID">
                                <option>--课时--</option>
                                @{
                                    foreach (var item in hour)
                                    {
                                <option value="@item.HourId">@item.HTitle</option>
                                    }
                                }

                            </select>
                        </div>
                        <div class="form-group">
                            <input class="form-control" name="NoteContent" id="NoteContent" placeholder="内容" type="text">
                        </div>
                        <span class="divider"></span>
                        <button class="btn btn-primary" type="submit" name="sousuo">搜索</button>
                    </form>
                </div>
                <div id="note-table-container">
                    <table class="table table-striped table-hover" id="note-table">
                        <thead>
                            <tr>
                                <th>选择</th>
                                <th>编号</th>
                                <th style="width:350px;">内容</th>
                                <th>作者</th>
                                <th>所属课时</th>
                                <th>所属课程</th>
                                <th>是否分享</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @{
                                foreach (var item in Model)
                                {
                            <tr>
                                <td><input data-role="batch-select" id="che" name="check" value="@item.ID" type="checkbox"></td>

                                <td>@item.ID</td>
                                <td style="width:300px;">@item.NoteContent</td>
                                <td>
                                    <a href="javascript:;" role="show-user" data-toggle="modal" data-target="#modal" data-url="http://www.zhishile.com/admin/user/18">@item.UserInfo.Uname</a>

                                    <br>
                                    <span class="text-muted text-sm">@item.NoteTime</span>
                                </td>
                                <td>@item.Hour.HTitle</td>
                                <td>@item.course.CoursesName</td>
                                <td>@(item.Share==0?" 未分享":"已分享")</td>
                                <td>
                                    <a class="btn btn-default btn-sm" data-role="item-delete" data-name="笔记" data-url="/admin/note/4/delete" href="/Course/DelNotes/@item.ID" onclick="return confirm('您确定要删除吗？')">删除</a>
                                </td>
                            </tr>
                                }
                            }
                        </tbody>
                    </table>



   


                    <a class="btn btn-default" href="/Course/Notes/?PageIndex=1&HourID=@ViewBag.HourID&NoteContent=@ViewBag.NoteContent">首页</a>
                    <a href="/Course/Notes/?PageIndex=@(ViewBag.PageIndex-1)&HourID=@ViewBag.HourID&NoteContent=@ViewBag.NoteContent" class="btn btn-default">上一页</a>
                    @{
                        //显示5个页码
                        //开始页码  （后5个页码  开始页码从倒数第5个开始）
                        int MinIndex = ViewBag.PageIndex;
                        if (MinIndex + 4 > ViewBag.PageCount)
                        {
                            MinIndex = ViewBag.PageCount - 4 < 1 ? 1 : ViewBag.PageCount - 4;
                        }
                        //结束页码要在pageCount范围内
                        int MaxIndex = ViewBag.PageIndex + 4;
                        if (MaxIndex > ViewBag.PageCount)
                        {
                            MaxIndex = ViewBag.PageCount;
                        }
                    }

                    @for (int i = MinIndex; i <= MaxIndex; i++)
                    {
                        <a href="/Course/Notes/?PageIndex=@i&HourID=@ViewBag.HourID& notecontent=@ViewBag.NoteContent" class="btn  @(ViewBag.PageIndex == i ? "btn-primary" : "btn-default")">@i</a>
                    }

                    <a href="/Course/Notes/?PageIndex=@(ViewBag.PageIndex+1)&HourID=@ViewBag.HourID&NoteContent=@ViewBag.NoteContent" class="btn btn-default">下一页</a>
                    <a href="/Course/Notes/?PageIndex=@ViewBag.PageCount  &HourID=@ViewBag.HourID& NoteContent = @ViewBag.NoteContent" class="btn btn-default">尾页</a>
                    <span style="margin-left:50px">每页 <b style="color:#ff0000">@ViewBag.PageSize </b>条/共 <b style="color:#ff0000"> @ViewBag.PageCount</b> 页</span>
                   
                    <span style="margin-left:280px;"><label class="checkbox-inline"><input data-role="batch-select" id="ch" onclick="QX()" type="checkbox"> 全选</label></span>
                    <span style="margin-left:20px"><button class="btn btn-default btn-sm mlm" data-role="batch-delete" data-name="笔记" type="button" data-url="/admin/note/batch_delete" onclick="PLDel()">批量删除</button></spanstyle>
                       
                        
                
                </div>
                <div>

                </div>
            </div>
        </div>
    </div>

    <script>
        var app = {};
        app.debug = false;
        app.version = '6.9.6';
        app.httpHost = 'http://www.zhishile.com';
        app.basePath = '';
        app.theme = 'jianmo';
        app.themeGlobalScript = 'theme/global-script';
        app.jsPaths = { "common": "common", "theme": "\/themes\/jianmo\/js", "customwebbundle": "\/bundles\/customweb\/js", "customadminbundle": "\/bundles\/customadmin\/js", "topxiawebbundle": "\/bundles\/topxiaweb\/js", "topxiaadminbundle": "\/bundles\/topxiaadmin\/js", "classroombundle": "\/bundles\/classroom\/js" };

        app.crontab = '/common/crontab';

        var CKEDITOR_BASEPATH = app.basePath + '/assets/libs/ckeditor/4.6.7/';

        app.config = { "api": { "weibo": { "key": "" }, "qq": { "key": "" }, "douban": { "key": "" }, "renren": { "key": "" } }, "cloud": { "video_player": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/GrindPlayer.swf", "video_player_watermark_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Watermake-1.0.3.swf", "video_player_fingerprint_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Fingerprint-1.0.1.swf" }, "loading_img_path": "\/assets\/img\/default\/loading.gif?6.9.6" };

        app.arguments = {};
        app.controller = 'course/note';

        app.scripts = null;

        app.uploadUrl = '/file/upload';
        app.imgCropUrl = '/file/img/crop';
        app.lessonCopyEnabled = '0';

        app.mainScript = '/bundles/topxiaadmin/js/admin-app.js?6.9.6';
    </script>
    <script src="~/Content/js/sea.js"></script>
    <script src="~/Content/js/seajs-style.js"></script>
    <script src="~/Content/js/seajs-global-config.js"></script>
    <script>
        seajs.use(app.mainScript);
    </script>  <div id="modal" class="modal"></div>
    <div class="fixed-bar">
        <a href="/admin/feedback" target="_blank" class="icon-question-text feedback">
            <i class="es-icon es-icon-help"></i>
            <span>产品<br>反馈</span>
        </a>
    </div>


</body>
</html>